/* eslint-disable */
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router);
//定义全局域名 在路由当中对各个文件进行限制
export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    scrollBehavior(to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        } else {
            if (from.meta.keepAlive) {
                from.meta.savedPosition = document.body.scrollTop;
            }
            return {
                x: 0,
                y: to.meta.savedPosition || 0
            }
        }
    },
    routes: [{
            path: '',
            redirect: '/m/first'
        },
        {
            path: '/m',
            redirect: '/m/first'
        },
        {
            path: '/m/first',
            component: (resolve) => require(['./views/v1/first.vue'], resolve),
            meta: {
                title: '首页'
            }
        },
        {
            path: '/m/hot',
            component: (resolve) => require(['./views/v1/hot.vue'], resolve),
            meta: {
                title: '热文'
            }
        },

        {
            path: '/m/hotmp',
            component: (resolve) => require(['./views/v1/hot_back.vue'], resolve),
            meta: {
                title: '热文'
            }
        }, {
            path: '/m/updatename',
            component: (resolve) => require(['./views/v1/updatename.vue'], resolve),
            meta: {
                title: '修改昵称'
            }
        },
        {
            path: '/m/seggestion',
            component: (resolve) => require(['./views/v1/seggestion.vue'], resolve),
            meta: {
                title: '填写意见'
            }
        },
        {
            path: '/m/search',
            component: (resolve) => require(['./views/v1/search.vue'], resolve),
            meta: {
                title: '搜索'
            }
        },
        {
            path: '/m/noads',
            component: (resolve) => require(['./views/v1/noads.vue'], resolve),
            meta: {
                title: '屏蔽广告'
            }
        },
        {
            path: '/m/login',
            component: (resolve) => require(['./views/v1/login.vue'], resolve),
            meta: {
                title: '登陆'
            }
        },
        {
            path: '/m/additem',
            component: (resolve) => require(['./views/v1/additem.vue'], resolve),
            meta: {
                title: '添加栏目'
            }
        },
        {
            path: '/m/loginout',
            component: (resolve) => require(['./views/v1/loginout.vue'], resolve),
            meta: {
                title: '会员退出'
            }
        },
        {
            path: '/m/updateheadert',
            component: (resolve) => require(['./views/v1/updateheader.vue'], resolve),
            meta: {
                title: '编辑信息'
            }
        },
        {
            path: '/m/rank',
            component: (resolve) => require(['./views/v1/rank.vue'], resolve),
            meta: {
                title: '热搜排行榜'
            }
        }
    ]

})